﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MySql.Data;
using MySql.Data.MySqlClient;

namespace PMSSys
{
    class icdController
    {
        private DBconnentor dbConnect;
        public DBconnentor DbConnect
        {
            set { dbConnect = value; }
            get { return dbConnect; }
        }

        public Patient objectFiller(Patient pObject)
        {

            return pObject;
        }

        public bool addIcd(ICD icd)
        {
            MySqlCommand query = new MySqlCommand(@"INSERT INTO incdata(p_id, chiefcompliant,   hpi,   bcg,   dtp,   opvipv,   hib,   hepb,    mmr,   vari,   hpv,   otherimmunization,   familycancer,   familyhemo,
              familyvwf,   familyanemia,   familyothers,   familyothersnotes,   pastillness,   pastsurgery,   pastmedications,   allergies,   envirohistory,  psychohistory,
              vitalt,   vitalweight,   vitalheight,   vitalbsa,   vitalrr,   vitalhr,   vitalbp,   vitalpain,   vitalperform_lev,   skinlesions,   skinnolesions,   skinlocation,
              heent_conj_normal,   heent_conj_pale,   heent_sclerae_normal,   heent_sclerae_yellow,   heent_thyr_normal,   heent_thyr_enlarged,   heent_thyr_enlargednotes,   heent_crn_normal,   heent_crn_enlarged,
              heent_crn_enlargednotes,   heent_tonsils_normal,   heent_tonsils_enlarged,   heent_tonsils_exudates,   heent_tonsils_beefy,   heent_tm_normal,   heent_tm_perforated,   heent_tm_discharged, 
              chestrythm_regu,   chestrythm_irreg,   chestrythm_murmur,   chestrythm_thrill,   chestbreast_smr,   lungsnormal,   lungsabnormal,   lungsabnormalnotes,   extremitiesnormal,   extremitiesabnormal,
              extremitiesabnormalnotes,   rectalnormal,   rectalabnormal,   rectalabnormalnotes,   endocrinenormal,   endocrineabnormal,   endocrineabnormalnotes,   hematologicnormal,   hematologicabnormal,
              hematologicabnormalnotes,   genitalianormal,   genitaliaabnormal,   genitaliaabnormalnotes,   smrrating,   phys_others,   phys_perflevel,   cbchgb,   cbchct,   cbcplatelet,
              cbcwbc,   cbcstabs,   cbcseg,   cbcl,   cbcm,   cbce,   cbcblast,   cbcreticulyte_count,   cbcrpi,   cbcmchc,   cbcmchcnotes,   cbcmch,   cbcmchnotes,
              cbcmcv,   cbcmcvnotes,   perismearrbc,   perismearrbcnotes,   perismearaniso,   perismearanisonotes,   perismearpoikilo,   perismearpoikilonotes,   perismearwbc,   perismearwbcnotes,
              perismearb,   perismearn,   perismearl,   perismear2b,   perismeare,   perismearm,   perismearblast,   perismearplatelets,   perismearadeq,   perismearinc,
              perismeardec,   perismearmacro,   perismearmicro,   perismearinterpre,   coagprofblledtime,   coagprofclottime,   coagprofpt,   coagproffdp,   coagprofaptt,   coagprofothers,
              coagprofviii,   coagprofix,   coagproffibri,   coagprofdmmers,   plateaggregationtests,   hemoglobinelectronotes,   bonemsmerythropoiesis,   bonemsmgranulopoiesis,   bonemsmmegakaryopoiesis,
              bonemsmothers,   bonemsminterpretations, bonemrbiopsydate,   bonemrbiopsynotes, histopathologydate,   histopathologynotes, chromodate,   chromonotes, cytochemdate,
              cytochempas,   cytochemmpo,   cytochemsbb,   cytochemothers, immunophenodate,   immunophenocd3,   immunophenocd5,   immunophenocd7,   immunophenocd10,   immunophenoantihladr,
              immunophenocd13,   immunophenocd19,   immunophenocd20,   immunophenocd22,   immunophenocd33,   immunophenocd34,   immunophenoothers, bonescandate,   bonescannotes, ctscandate,
              ctscannotes, chestxraydate,  chestxraynotes,   labdataothers,   impressiondiagnosis, othernotes) VALUES (@P_ID, @CHIEFCOMPLIANT,   @HPI,   @BCG,   @DTP,   @OPVIPV,   @HIB,   @HEPB,    @MMR,   @VARI,   @HPV,   @OTHERIMMUNIZATION,   @FAMILYCANCER,   @FAMILYHEMO,
              @FAMILYVWF,   @FAMILYANEMIA,   @FAMILYOTHERS,   @FAMILYOTHERSNOTES,   @PASTILLNESS,   @PASTSURGERY,   @PASTMEDICATIONS,   @ALLERGIES,   @ENVIROHISTORY,  @PSYCHOHISTORY,
              @VITALT,   @VITALWEIGHT,   @VITALHEIGHT,   @VITALBSA,   @VITALRR,   @VITALHR,   @VITALBP,   @VITALPAIN,   @VITALPERFORM_LEV,   @SKINLESIONS,   @SKINNOLESIONS,   @SKINLOCATION,
              @HEENT_CONJ_NORMAL,   @HEENT_CONJ_PALE,   @HEENT_SCLERAE_NORMAL,   @HEENT_SCLERAE_YELLOW,   @HEENT_THYR_NORMAL,   @HEENT_THYR_ENLARGED,   @HEENT_THYR_ENLARGEDNOTES,   @HEENT_CRN_NORMAL,   @HEENT_CRN_ENLARGED,
              @HEENT_CRN_ENLARGEDNOTES,   @HEENT_TONSILS_NORMAL,   @HEENT_TONSILS_ENLARGED,   @HEENT_TONSILS_EXUDATES,   @HEENT_TONSILS_BEEFY,   @HEENT_TM_NORMAL,   @HEENT_TM_PERFORATED,   @HEENT_TM_DISCHARGED, 
              @CHESTRYTHM_REGU,   @CHESTRYTHM_IRREG,   @CHESTRYTHM_MURMUR,   @CHESTRYTHM_THRILL,   @CHESTBREAST_SMR,   @LUNGSNORMAL,   @LUNGSABNORMAL,   @LUNGSABNORMALNOTES,   @EXTREMITIESNORMAL,   @EXTREMITIESABNORMAL,
              @EXTREMITIESABNORMALNOTES,   @RECTALNORMAL,   @RECTALABNORMAL,   @RECTALABNORMALNOTES,   @ENDOCRINENORMAL,   @ENDOCRINEABNORMAL,   @ENDOCRINEABNORMALNOTES,   @HEMATOLOGICNORMAL,   @HEMATOLOGICABNORMAL,
              @HEMATOLOGICABNORMALNOTES,   @GENITALIANORMAL,   @GENITALIAABNORMAL,   @GENITALIAABNORMALNOTES,   @SMRRATING,   @PHYS_OTHERS,   @PHYS_PERFLEVEL,   @CBCHGB,   @CBCHCT,   @CBCPLATELET,
              @CBCWBC,   @CBCSTABS,   @CBCSEG,   @CBCL,   @CBCM,   @CBCE,   @CBCBLAST,   @CBCRETICULYTE_COUNT,   @CBCRPI,   @CBCMCHC,   @CBCMCHCNOTES,   @CBCMCH,   @CBCMCHNOTES,
              @CBCMCV,   @CBCMCVNOTES,   @PERISMEARRBC,   @PERISMEARRBCNOTES,   @PERISMEARANISO,   @PERISMEARANISONOTES,   @PERISMEARPOIKILO,   @PERISMEARPOIKILONOTES,   @PERISMEARWBC,   @PERISMEARWBCNOTES,
              @PERISMEARB,   @PERISMEARN,   @PERISMEARL,   @PERISMEAR2B,   @PERISMEARE,   @PERISMEARM,   @PERISMEARBLAST,   @PERISMEARPLATELETS,   @PERISMEARADEQ,   @PERISMEARINC,
              @PERISMEARDEC,   @PERISMEARMACRO,   @PERISMEARMICRO,   @PERISMEARINTERPRE,   @COAGPROFBLLEDTIME,   @COAGPROFCLOTTIME,   @COAGPROFPT,   @COAGPROFFDP,   @COAGPROFAPTT,   @COAGPROFOTHERS,
              @COAGPROFVIII,   @COAGPROFIX,   @COAGPROFFIBRI,   @COAGPROFDMMERS,   @PLATEAGGREGATIONTESTS,   @HEMOGLOBINELECTRONOTES,   @BONEMSMERYTHROPOIESIS,   @BONEMSMGRANULOPOIESIS,   @BONEMSMMEGAKARYOPOIESIS,
              @BONEMSMOTHERS,   @BONEMSMINTERPRETATIONS, @BONEMRBIOPSYDATE,   @BONEMRBIOPSYNOTES, @HISTOPATHOLOGYDATE,   @HISTOPATHOLOGYNOTES, @CHROMODATE,   @CHROMONOTES, @CYTOCHEMDATE,
              @CYTOCHEMPAS,   @CYTOCHEMMPO,   @CYTOCHEMSBB,   @CYTOCHEMOTHERS, @IMMUNOPHENODATE,   @IMMUNOPHENOCD3,   @IMMUNOPHENOCD5,   @IMMUNOPHENOCD7,   @IMMUNOPHENOCD10,   @IMMUNOPHENOANTIHLADR,
              @IMMUNOPHENOCD13,   @IMMUNOPHENOCD19,   @IMMUNOPHENOCD20,   @IMMUNOPHENOCD22,   @IMMUNOPHENOCD33,   @IMMUNOPHENOCD34,   @IMMUNOPHENOOTHERS, @BONESCANDATE,   @BONESCANNOTES, @CTSCANDATE,
              @CTSCANNOTES, CHESTXRAYDATE,  @CHESTXRAYNOTES,   @LABDATAOTHERS,   @IMPRESSIONDIAGNOSIS, @OTHERNOTES)", dbConnect.getConnection());
            query.Parameters.Add(new MySqlParameter("@P_ID", MySqlDbType.String)).Value = icd.PatientID;
            query.Parameters.Add(new MySqlParameter("@CHIEFCOMPLIANT", MySqlDbType.String)).Value = icd.Chiefcomplaint;
            query.Parameters.Add(new MySqlParameter("@HPI", MySqlDbType.Int16)).Value = icd.Hpi;
            query.Parameters.Add(new MySqlParameter("@BCG", MySqlDbType.Int16)).Value = icd.Bcg;
            query.Parameters.Add(new MySqlParameter("@DTP", MySqlDbType.Int16)).Value = icd.Dtp;
            query.Parameters.Add(new MySqlParameter("@OPVIPV", MySqlDbType.Int16)).Value = icd.Opvipv;
            query.Parameters.Add(new MySqlParameter("@HIB", MySqlDbType.Int16)).Value = icd.Hib;
            query.Parameters.Add(new MySqlParameter("@HEPB", MySqlDbType.Int16)).Value = icd.Hepb;
            query.Parameters.Add(new MySqlParameter("@MMR", MySqlDbType.Int16)).Value = icd.Mmr;
            query.Parameters.Add(new MySqlParameter("@VARI", MySqlDbType.Int16)).Value = icd.Vari;
            query.Parameters.Add(new MySqlParameter("@HPV", MySqlDbType.Int16)).Value = icd.Hpv;
            query.Parameters.Add(new MySqlParameter("@OTHERIMMUNIZATION", MySqlDbType.String)).Value = icd.Otherimmunization;
            query.Parameters.Add(new MySqlParameter("@FAMILYCANER", MySqlDbType.String)).Value = icd.Familycancer;
            query.Parameters.Add(new MySqlParameter("@FAMILYHEMO", MySqlDbType.Int16)).Value = icd.Familyhemo;
            query.Parameters.Add(new MySqlParameter("@FAMILYVWF", MySqlDbType.Int16)).Value = icd.Familyvwf;
            query.Parameters.Add(new MySqlParameter("@FAMILYANEMIA", MySqlDbType.String)).Value = icd.Familyanemia;
            query.Parameters.Add(new MySqlParameter("@FAMILYOTHERS", MySqlDbType.Int16)).Value = icd.Familyothers;
            query.Parameters.Add(new MySqlParameter("@FAMILYOTHERSNOTES", MySqlDbType.String)).Value = icd.Familyothersnotes;
            query.Parameters.Add(new MySqlParameter("@PASTILLNESS", MySqlDbType.String)).Value = icd.Pastillness;
            query.Parameters.Add(new MySqlParameter("@PASTSURGERY", MySqlDbType.String)).Value = icd.Pastsurgery;
            query.Parameters.Add(new MySqlParameter("@PASTMEDICATIONS", MySqlDbType.String)).Value = icd.Pastmedications;
            query.Parameters.Add(new MySqlParameter("@ALLERGIES", MySqlDbType.String)).Value = icd.Allergies;
            query.Parameters.Add(new MySqlParameter("@ENVIROHISTORY", MySqlDbType.String)).Value = icd.Envirohistory;
            query.Parameters.Add(new MySqlParameter("@PSYCHOHISTORY", MySqlDbType.String)).Value = icd.Psychohistory;
            query.Parameters.Add(new MySqlParameter("@VITALT", MySqlDbType.String)).Value = icd.Vitalt;
            query.Parameters.Add(new MySqlParameter("@VITALWEIGHT", MySqlDbType.String)).Value = icd.Vitalweight;
            query.Parameters.Add(new MySqlParameter("@VITALHEIGHT", MySqlDbType.String)).Value = icd.Vitalheight;
            query.Parameters.Add(new MySqlParameter("@VITALBSA", MySqlDbType.String)).Value = icd.Vitalbsa;
            query.Parameters.Add(new MySqlParameter("@VITALRR", MySqlDbType.String)).Value = icd.Vitalrr;
            query.Parameters.Add(new MySqlParameter("@VITALHR", MySqlDbType.String)).Value = icd.Vitalhr;
            query.Parameters.Add(new MySqlParameter("@VITALBP", MySqlDbType.String)).Value = icd.Vitalbp;
            query.Parameters.Add(new MySqlParameter("@VITALPAIN", MySqlDbType.String)).Value = icd.Vitalpain;
            query.Parameters.Add(new MySqlParameter("@VITALPERFORM_LEV", MySqlDbType.String)).Value = icd.Vitalperform_lev;
            query.Parameters.Add(new MySqlParameter("@SKINLESIONS", MySqlDbType.Int16)).Value = icd.Skinlesions;
            query.Parameters.Add(new MySqlParameter("@SKINNOLESIONS", MySqlDbType.Int16)).Value = icd.Skinnolesions;
            query.Parameters.Add(new MySqlParameter("@SKINLOCATION", MySqlDbType.String)).Value = icd.Skinlocation;
            query.Parameters.Add(new MySqlParameter("@HEENT_CONJ_NORMAL", MySqlDbType.Int16)).Value = icd.Heent_conj_normal;
            query.Parameters.Add(new MySqlParameter("@HEENT_CONJ_PALE", MySqlDbType.Int16)).Value = icd.Heent_conj_pale;
            query.Parameters.Add(new MySqlParameter("@HEENT_SCLERAE_NORMAL", MySqlDbType.Int16)).Value = icd.Heent_sclerae_normal;
            query.Parameters.Add(new MySqlParameter("@HEENT_SCLERAE_YELLOW", MySqlDbType.Int16)).Value = icd.Heent_sclerae_yellow;
            query.Parameters.Add(new MySqlParameter("@HEENT_THYR_NORMAL", MySqlDbType.Int16)).Value = icd.Heent_thyr_normal;
            query.Parameters.Add(new MySqlParameter("@HEENT_THYR_ENLARGED", MySqlDbType.Int16)).Value = icd.Heent_thyr_enlarged;
            query.Parameters.Add(new MySqlParameter("@HEENT_THYR_ENLARGEDNOTES", MySqlDbType.String)).Value = icd.Heent_thyr_enlargednotes;
            query.Parameters.Add(new MySqlParameter("@HEENT_CRN_NORMAL", MySqlDbType.Int16)).Value = icd.Heent_crn_normal;
            query.Parameters.Add(new MySqlParameter("@HEENT_CRN_ENLARGED", MySqlDbType.Int16)).Value = icd.Heent_crn_enlarged;
            query.Parameters.Add(new MySqlParameter("@HEENT_CRN_ENLARGEDNOTES", MySqlDbType.String)).Value = icd.Heent_crn_enlargednotes;
            query.Parameters.Add(new MySqlParameter("@HEENT_TONSILS_NORMAL", MySqlDbType.Int16)).Value = icd.Heent_tonsils_normal;
            query.Parameters.Add(new MySqlParameter("@HEENT_TONSILS_ENLARGED", MySqlDbType.Int16)).Value = icd.Heent_tonsils_enlarged;
            query.Parameters.Add(new MySqlParameter("@HEENT_TONSILS_EXUDATES", MySqlDbType.Int16)).Value = icd.Heent_tonsils_exudates;
            query.Parameters.Add(new MySqlParameter("@HEENT_TONSILS_BEEFY", MySqlDbType.Int16)).Value = icd.Heent_tonsils_beefy;
            query.Parameters.Add(new MySqlParameter("@HEENT_TM_NORMAL", MySqlDbType.Int16)).Value = icd.Heent_tm_normal;
            query.Parameters.Add(new MySqlParameter("@HEENT_TM_PERFORATEDL", MySqlDbType.Int16)).Value = icd.Heent_tm_perforated;
            query.Parameters.Add(new MySqlParameter("@HEENT_TM_DISCHARGED", MySqlDbType.Int16)).Value = icd.Heent_tm_discharged;
            query.Parameters.Add(new MySqlParameter("@CHESTRYTHM_REGU", MySqlDbType.Int16)).Value = icd.Chestrythm_regu;
            query.Parameters.Add(new MySqlParameter("@CHESTRYTHM_IRREG", MySqlDbType.Int16)).Value = icd.Chestrythm_irreg;
            query.Parameters.Add(new MySqlParameter("@CHESTRYTHM_MURMUR", MySqlDbType.Int16)).Value = icd.Chestrythm_murmur;
            query.Parameters.Add(new MySqlParameter("@CHESTRYTHM_THRILL", MySqlDbType.Int16)).Value = icd.Chestrythm_thrill;
            query.Parameters.Add(new MySqlParameter("@CHESTBREAST_SMR", MySqlDbType.String)).Value = icd.Chestbreast_smr;
            query.Parameters.Add(new MySqlParameter("@LUNGSNORMAL", MySqlDbType.Int16)).Value = icd.Lungsnormal;
            query.Parameters.Add(new MySqlParameter("@LUNGSABNORMAL", MySqlDbType.Int16)).Value = icd.Lungsabnormal;
            query.Parameters.Add(new MySqlParameter("@LUNGSABNORMALNOTES", MySqlDbType.String)).Value = icd.Lungsabnormalnotes;
            query.Parameters.Add(new MySqlParameter("@EXTREMITIESNORMAL", MySqlDbType.Int16)).Value = icd.Extremitiesnormal;
            query.Parameters.Add(new MySqlParameter("@EXTREMITIESABNORMAL", MySqlDbType.Int16)).Value = icd.Extremitiesabnormal;
            query.Parameters.Add(new MySqlParameter("@EXTREMITIESABNORMALNOTES", MySqlDbType.String)).Value = icd.Extremitiesabnormalnotes;
            query.Parameters.Add(new MySqlParameter("@RECTALNORMAL", MySqlDbType.Int16)).Value = icd.Rectalnormal;
            query.Parameters.Add(new MySqlParameter("@RECTALABNORMAL", MySqlDbType.Int16)).Value = icd.Rectalabnormal;
            query.Parameters.Add(new MySqlParameter("@RECTALABNORMALNOTES", MySqlDbType.String)).Value = icd.Rectalabnormalnotes;
            query.Parameters.Add(new MySqlParameter("@ENDOCRINENORMAL", MySqlDbType.Int16)).Value = icd.Endocrinenormal;
            query.Parameters.Add(new MySqlParameter("@ENDOCRINEABNORMAL", MySqlDbType.Int16)).Value = icd.Endocrineabnormal;
            query.Parameters.Add(new MySqlParameter("@ENDOCRINEABNORMALNOTES", MySqlDbType.String)).Value = icd.Endocrineabnormalnotes;
            query.Parameters.Add(new MySqlParameter("@HEMATOLOGICNORMAL", MySqlDbType.Int16)).Value = icd.Hematologicnormal;
            query.Parameters.Add(new MySqlParameter("@HEMATOLOGICABNORMAL", MySqlDbType.Int16)).Value = icd.Hematologicabnormal;
            query.Parameters.Add(new MySqlParameter("@HEMATOLOGICABNORMALNOTES", MySqlDbType.String)).Value = icd.Hematologicabnormalnotes;
            query.Parameters.Add(new MySqlParameter("@GENITALIANORMAL", MySqlDbType.Int16)).Value = icd.Genitalianormal;
            query.Parameters.Add(new MySqlParameter("@GENITALIAABNORMAL", MySqlDbType.Int16)).Value = icd.Genitaliaabnormal;
            query.Parameters.Add(new MySqlParameter("@GENITALIAABNORMALNOTES", MySqlDbType.String)).Value = icd.Genitaliaabnormalnotes;
            query.Parameters.Add(new MySqlParameter("@SMRRATING", MySqlDbType.String)).Value = icd.Smrrating;
            query.Parameters.Add(new MySqlParameter("@PHYS_OTHERS", MySqlDbType.String)).Value = icd.Phys_others;
            query.Parameters.Add(new MySqlParameter("@PHYS_PERFLEVEL", MySqlDbType.String)).Value = icd.Phys_perflevel;
            query.Parameters.Add(new MySqlParameter("@CBCHGB", MySqlDbType.String)).Value = icd.Cbchgb;
            query.Parameters.Add(new MySqlParameter("@CBCHCT", MySqlDbType.String)).Value = icd.Cbchct;
            query.Parameters.Add(new MySqlParameter("@CBCPLATELET", MySqlDbType.String)).Value = icd.Cbcplatelet;
            query.Parameters.Add(new MySqlParameter("@CBCWBC", MySqlDbType.String)).Value = icd.Cbcwbc;
            query.Parameters.Add(new MySqlParameter("@CBCSTABS", MySqlDbType.String)).Value = icd.Cbcstabs;
            query.Parameters.Add(new MySqlParameter("@CBCSEG", MySqlDbType.String)).Value = icd.Cbcseg;
            query.Parameters.Add(new MySqlParameter("@CBCL", MySqlDbType.String)).Value = icd.Cbcl;
            query.Parameters.Add(new MySqlParameter("@CBCM", MySqlDbType.String)).Value = icd.Cbcm;
            query.Parameters.Add(new MySqlParameter("@CBCE", MySqlDbType.String)).Value = icd.Cbce;
            query.Parameters.Add(new MySqlParameter("@CBCBLAST", MySqlDbType.String)).Value = icd.Cbcblast;
            query.Parameters.Add(new MySqlParameter("@CBCRETICULYTE_COUNT", MySqlDbType.String)).Value = icd.Cbcreticulyte_count;
            query.Parameters.Add(new MySqlParameter("@CBCRPI", MySqlDbType.String)).Value = icd.Cbcrpi;
            query.Parameters.Add(new MySqlParameter("@CBCMCHC", MySqlDbType.Int16)).Value = icd.Cbcmchc;
            query.Parameters.Add(new MySqlParameter("@CBCMCHCNOTES", MySqlDbType.String)).Value = icd.Cbcmchcnotes;
            query.Parameters.Add(new MySqlParameter("@CBCMCH", MySqlDbType.Int16)).Value = icd.Cbcmch;
            query.Parameters.Add(new MySqlParameter("@CBCMCHNOTES", MySqlDbType.String)).Value = icd.Cbcmchnotes;
            query.Parameters.Add(new MySqlParameter("@CBCMCV", MySqlDbType.Int16)).Value = icd.Cbcmcv;
            query.Parameters.Add(new MySqlParameter("@CBCMCVNOTES", MySqlDbType.String)).Value = icd.Cbcmcvnotes;
            query.Parameters.Add(new MySqlParameter("@PERISMEARRBC", MySqlDbType.Int16)).Value = icd.Perismearrbc;
            query.Parameters.Add(new MySqlParameter("@PERISMEARRBCNOTES", MySqlDbType.String)).Value = icd.Perismearrbcnotes;
            query.Parameters.Add(new MySqlParameter("@PERISMEARANISO", MySqlDbType.Int16)).Value = icd.Perismearaniso;
            query.Parameters.Add(new MySqlParameter("@PERISMEARANISONOTES", MySqlDbType.String)).Value = icd.Perismearanisonotes;
            query.Parameters.Add(new MySqlParameter("@PERISMEARPOIKILO", MySqlDbType.Int16)).Value = icd.Perismearpoikilo;
            query.Parameters.Add(new MySqlParameter("@PERISMEARPOIKILONOTES", MySqlDbType.String)).Value = icd.Perismearpoikilonotes;
            query.Parameters.Add(new MySqlParameter("@PERISMEARWBC", MySqlDbType.Int16)).Value = icd.Perismearwbc;
            query.Parameters.Add(new MySqlParameter("@PERISMEARWBCNOTES", MySqlDbType.String)).Value = icd.Perismearwbcnotes;
            query.Parameters.Add(new MySqlParameter("@PERISMEARB", MySqlDbType.String)).Value = icd.Perismearb;
            query.Parameters.Add(new MySqlParameter("@PERISMEARN", MySqlDbType.String)).Value = icd.Perismearn;
            query.Parameters.Add(new MySqlParameter("@PERISMEARL", MySqlDbType.String)).Value = icd.Perismearl;
            query.Parameters.Add(new MySqlParameter("@PERISMEAR2B", MySqlDbType.String)).Value = icd.Perismear2b;
            query.Parameters.Add(new MySqlParameter("@PERISMEARE", MySqlDbType.String)).Value = icd.Perismeare;
            query.Parameters.Add(new MySqlParameter("@PERISMEARM", MySqlDbType.String)).Value = icd.Perismearm;
            query.Parameters.Add(new MySqlParameter("@PERISMEARBLAST", MySqlDbType.String)).Value = icd.Perismearblast;
            query.Parameters.Add(new MySqlParameter("@PERISMEARPLATELETS", MySqlDbType.Int16)).Value = icd.Perismearplatelets;
            query.Parameters.Add(new MySqlParameter("@PERISMEARADEQ", MySqlDbType.String)).Value = icd.Perismearadeq;
            query.Parameters.Add(new MySqlParameter("@PERISMEARINC", MySqlDbType.String)).Value = icd.Perismearinc;
            query.Parameters.Add(new MySqlParameter("@PERISMEARDEC", MySqlDbType.String)).Value = icd.Perismeardec;
            query.Parameters.Add(new MySqlParameter("@PERISMEARMACRO", MySqlDbType.String)).Value = icd.Perismearmacro;
            query.Parameters.Add(new MySqlParameter("@PERISMEARMICRO", MySqlDbType.String)).Value = icd.Perismearmicro;
            query.Parameters.Add(new MySqlParameter("@PERISMEARINTERPRE", MySqlDbType.String)).Value = icd.Perismearinterpre;
            query.Parameters.Add(new MySqlParameter("@COAGPROFBLLEDTIME", MySqlDbType.String)).Value = icd.Coagprofblledtime;
            query.Parameters.Add(new MySqlParameter("@COAGPROFCLOTTIME", MySqlDbType.String)).Value = icd.Coagprofclottime;
            query.Parameters.Add(new MySqlParameter("@COAGPROFPT", MySqlDbType.String)).Value = icd.Coagprofpt;
            query.Parameters.Add(new MySqlParameter("@COAGPROFFDP", MySqlDbType.String)).Value = icd.Coagproffdp;
            query.Parameters.Add(new MySqlParameter("@COAGPROFAPTT", MySqlDbType.String)).Value = icd.Coagprofaptt;
            query.Parameters.Add(new MySqlParameter("@COAGPROFOTHERS", MySqlDbType.String)).Value = icd.Coagprofothers;
            query.Parameters.Add(new MySqlParameter("@COAGPROFVIII", MySqlDbType.String)).Value = icd.Coagprofviii;
            query.Parameters.Add(new MySqlParameter("@COAGPROFIX", MySqlDbType.String)).Value = icd.Coagprofix;
            query.Parameters.Add(new MySqlParameter("@COAGPROFFIBRI", MySqlDbType.String)).Value = icd.Coagproffibri;
            query.Parameters.Add(new MySqlParameter("@COAGPROFDMMERS", MySqlDbType.String)).Value = icd.Coagprofdmmers;
            query.Parameters.Add(new MySqlParameter("@PLATEAGGREGATIONTESTS", MySqlDbType.String)).Value = icd.Plateaggregationtests;
            query.Parameters.Add(new MySqlParameter("@HEMOGLOBINELECTRONOTES", MySqlDbType.String)).Value = icd.Hemoglobinelectronotes;
            query.Parameters.Add(new MySqlParameter("@BONEMSMERYTHROPOIESIS", MySqlDbType.String)).Value = icd.Bonemsmerythropoiesis;
            query.Parameters.Add(new MySqlParameter("@BONEMSMGRANULOPOIESIS", MySqlDbType.String)).Value = icd.Bonemsmgranulopoiesis;
            query.Parameters.Add(new MySqlParameter("@BONEMSMMEGAKARYOPOIESIS", MySqlDbType.String)).Value = icd.Bonemsmmegakaryopoiesis;
            query.Parameters.Add(new MySqlParameter("@BONEMSMOTHERS", MySqlDbType.String)).Value = icd.Bonemsmothers;
            query.Parameters.Add(new MySqlParameter("@BONEMSMINTERPRETATIONS", MySqlDbType.String)).Value = icd.Bonemsminterpretations;
            query.Parameters.Add(new MySqlParameter("@BONEMRBIOPSYDATE", MySqlDbType.DateTime)).Value = icd.Bonemrbiopsydate;
            query.Parameters.Add(new MySqlParameter("@BONEMRBIOPSYNOTES", MySqlDbType.String)).Value = icd.Bonemrbiopsynotes;
            query.Parameters.Add(new MySqlParameter("@HISTOPATHOLOGYDATE", MySqlDbType.DateTime)).Value = icd.Histopathologydate;
            query.Parameters.Add(new MySqlParameter("@HISTOPATHOLOGYNOTES", MySqlDbType.String)).Value = icd.Histopathologynotes;
            query.Parameters.Add(new MySqlParameter("@CHROMODATE", MySqlDbType.DateTime)).Value = icd.Chromodate;
            query.Parameters.Add(new MySqlParameter("@CHROMONOTES", MySqlDbType.String)).Value = icd.Chromonotes;
            query.Parameters.Add(new MySqlParameter("@CYTOCHEMDATE", MySqlDbType.DateTime)).Value = icd.Cytochemdate;
            query.Parameters.Add(new MySqlParameter("@CYTOCHEMPAS", MySqlDbType.String)).Value = icd.Cytochempas;
            query.Parameters.Add(new MySqlParameter("@CYTOCHEMMPO", MySqlDbType.String)).Value = icd.Cytochemmpo;
            query.Parameters.Add(new MySqlParameter("@CYTOCHEMSBB", MySqlDbType.String)).Value = icd.Cytochemsbb;
            query.Parameters.Add(new MySqlParameter("@CYTOCHEMOTHERS", MySqlDbType.String)).Value = icd.Cytochemothers;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENODATE", MySqlDbType.DateTime)).Value = icd.Immunophenodate;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD3", MySqlDbType.String)).Value = icd.Immunophenocd3;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD5", MySqlDbType.String)).Value = icd.Immunophenocd5;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD7", MySqlDbType.String)).Value = icd.Immunophenocd7;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD10", MySqlDbType.String)).Value = icd.Immunophenocd10;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOANTIHLADR", MySqlDbType.String)).Value = icd.Immunophenoantihladr;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD13", MySqlDbType.String)).Value = icd.Immunophenocd13;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD19", MySqlDbType.String)).Value = icd.Immunophenocd19;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD20", MySqlDbType.String)).Value = icd.Immunophenocd20;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD22", MySqlDbType.String)).Value = icd.Immunophenocd22;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD33", MySqlDbType.String)).Value = icd.Immunophenocd33;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOCD34", MySqlDbType.String)).Value = icd.Immunophenocd34;
            query.Parameters.Add(new MySqlParameter("@IMMUNOPHENOOTHERS", MySqlDbType.String)).Value = icd.Immunophenoothers;
            query.Parameters.Add(new MySqlParameter("@BONESCANDATE", MySqlDbType.DateTime)).Value = icd.Bonescandate;
            query.Parameters.Add(new MySqlParameter("@BONESCANNOTES", MySqlDbType.String)).Value = icd.Bonescannotes;
            query.Parameters.Add(new MySqlParameter("@CTSCANDATE", MySqlDbType.DateTime)).Value = icd.Ctscandate;
            query.Parameters.Add(new MySqlParameter("@CTSCANNOTES", MySqlDbType.String)).Value = icd.Ctscannotes;
            query.Parameters.Add(new MySqlParameter("@CHESTXRAYDATE", MySqlDbType.DateTime)).Value = icd.Chestxraydate;
            query.Parameters.Add(new MySqlParameter("@CHESTXRAYNOTES", MySqlDbType.String)).Value = icd.Chestxraynotes;
            query.Parameters.Add(new MySqlParameter("@LABDATAOTHERS", MySqlDbType.String)).Value = icd.Labdataothers;
            query.Parameters.Add(new MySqlParameter("@IMPRESSIONDIAGNOSIS", MySqlDbType.String)).Value = icd.Impressiondiagnosis;
            query.Parameters.Add(new MySqlParameter("@OTHERNOTES", MySqlDbType.String)).Value = icd.Othernotes;

            return dbConnect.nonQueryExecute(query);
        }
        public bool Update(Patient pasyente)
        {
            MySqlCommand query = new MySqlCommand(@"UPDATE incdata SET p_fname = @P_FNAME,  p_lname = @P_LNAME,  p_mname = @P_MNAME, p_bday = @P_BDAY , p_sex = @P_SEX,  
            p_address = @P_ADDRESS,  p_telnum = @P_TELNUM,  p_cnumber = @P_CNUMBER,  p_fathername = @P_FATHERNAME,  p_fatheroccu = @P_FATHEROCCU, 
            p_mothername = @P_MOTHERNAME,  p_motheroccu = @P_MOTHEROCCU, p_siblingcnt = @SIBLINGCNT,  p_annualincome = @ANNUALINCOME,  p_referral = @P_REFERRAL)", dbConnect.getConnection());
            return dbConnect.nonQueryExecute(query);

        }
    }
}
